var core = require('core');
var db = core.db;
var send = core.send;

var count = function(req, res, next) {
    var body = req.body;

    db.schema.User.count(body, function(err, user){
        var SEND;
        if(err)
            SEND = new send(100000);
        else{
            SEND = new send(0);
            SEND.docs = user;
        };
        res.send(SEND);
    });
};

module.exports = count;
